package com.open.capacity.trade.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.open.capacity.common.model.Records;
import com.open.capacity.common.model.Remittance;
import com.open.capacity.common.web.PageResult;
import com.open.capacity.trade.vo.TradeRecordsVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;
@Mapper
public interface RecordsDao extends BaseMapper<Records> {
//    @Select("select * from records")
    PageResult<Records> findAllP(Map<String, Object> params);

//    @Select("select * from records")
    PageResult<Records> findAll();

    @Select("select * from records")
    List<Records> findAlls();

    int count(Map<String, Object> params);

    List<TradeRecordsVo> findAllRecords(Map<String, Object> params);

    @Select("select * from crm_records cr  where cr.id = #{id} and cr.records_id=#{recordsId}")
    Records findById(@Param("id") Long id, @Param("recordsId") Long recordsId);

    int updateOrEnabled(Records records);

    @Delete("delete from crm_records where id = #{id} and records_id=#{recordsId}")
    int deleteRecords(@Param("id") Long id,@Param("recordsId") Long recordsId);

    int insertRecords(Records records);

    @Select("select conduct from crm_records where id=#{id}")
    Integer findConduct(Records records);

    Integer updateEntry(Records byId);

    Records findBy(Records records);

    Records getPeople(Records records);

    Integer updateRecordsAccepted(Records peopleAndEntry);

    Records getRecords(Records records);

    Integer updateRecordsBasic(Records records);

//    int updateOrEnabled(Records records);
}
